using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using DAL;
using DTO;
using BUS;
using Utility;

public partial class Doanhnghiep_CapNhatTinhTrang : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
            int id = int.Parse(Request.QueryString["id"].ToString());
            tbSanPham sp = tbSanPhamBUS.GetByID(id);
            if (sp.tinhtrang == 30)
            {
                Response.Redirect("~/DoanhNghiep/SanPham_DN.aspx?id=" + sp.doanhnghiep.ToString());
            }
            else
            {
                sp.tinhtrang = 30;
                tbSanPhamBUS.Update(sp);
                Response.Redirect("~/DoanhNghiep/SanPham_DN.aspx?id=" + sp.doanhnghiep.ToString());
            }
        
    }
}
